package la.iok.hzsvn.lewin.movie.cloud.model;

import java.util.Objects;

public class UserLoginParam {
    /**
     * 手机号
     */
    private String phoneNumber;
    /**
     * 密码
     */
    private String password;
    /**
     * 验证码
     */
    private String code;

    /**
     * 客户端类型，webBrowser:浏览器
     */
    private String clientType;
    /**
     * 登录设备
     */
    private UserDeviceParam device;

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getClientType() {
        return clientType;
    }

    public void setClientType(String clientType) {
        this.clientType = clientType;
    }

    public UserDeviceParam getDevice() {
        return device;
    }

    public void setDevice(UserDeviceParam device) {
        this.device = device;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserLoginParam param = (UserLoginParam) o;
        return Objects.equals(phoneNumber, param.phoneNumber) && Objects.equals(password, param.password) && Objects.equals(code, param.code);
    }

    @Override
    public int hashCode() {
        return Objects.hash(phoneNumber, password, code);
    }

    public boolean clientWebBrowser(){
        return "webBrowser".equals(clientType);
    }
}
